Optimal. Leaf size=284 \[ \frac {B n (b c-a d) \log (g+h x) \left (a^2 d^2 h^2-a b d h (3 d g-c h)+b^2 \left (c^2 h^2-3 c d g h+3 d^2 g^2\right )\right )}{3 (b g-a h)^3 (d g-c h)^3}-\frac {B \log \left (e (a+b x)^n (c+d x)^{-n}\right )+A}{3 h (g+h x)^3}+\frac {b^3 B n \log (a+b x)}{3 h (b g-a h)^3}-\frac {B n (b c-a d) (-a d h-b c h+2 b d g)}{3 (g+h x) (b g-a h)^2 (d g-c h)^2}-\frac {B n (b c-a d)}{6 (g+h x)^2 (b g-a h) (d g-c h)}-\frac {B d^3 n \log (c+d x)}{3 h (d g-c h)^3} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.54, antiderivative size = 296, normalized size of antiderivative = 1.04, number of steps used = 5, number of rules used = 3, integrand size = 31, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.097, Rules used = {6742, 2492, 72} \[ \frac {B n (b c-a d) \log (g+h x) \left (a^2 d^2 h^2-a b d h (3 d g-c h)+b^2 \left (c^2 h^2-3 c d g h+3 d^2 g^2\right )\right )}{3 (b g-a h)^3 (d g-c h)^3}+\frac {b^3 B n \log (a+b x)}{3 h (b g-a h)^3}-\frac {B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{3 h (g+h x)^3}-\frac {B n (b c-a d) (-a d h-b c h+2 b d g)}{3 (g+h x) (b g-a h)^2 (d g-c h)^2}-\frac {B n (b c-a d)}{6 (g+h x)^2 (b g-a h) (d g-c h)}-\frac {A}{3 h (g+h x)^3}-\frac {B d^3 n \log (c+d x)}{3 h (d g-c h)^3} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 72
Rule 2492
Rule 6742
Rubi steps
\begin {align*} \int \frac {A+B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{(g+h x)^4} \, dx &=\int \left (\frac {A}{(g+h x)^4}+\frac {B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{(g+h x)^4}\right ) \, dx\\ &=-\frac {A}{3 h (g+h x)^3}+B \int \frac {\log \left (e (a+b x)^n (c+d x)^{-n}\right )}{(g+h x)^4} \, dx\\ &=-\frac {A}{3 h (g+h x)^3}-\frac {B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{3 h (g+h x)^3}+\frac {(B (b c-a d) n) \int \frac {1}{(a+b x) (c+d x) (g+h x)^3} \, dx}{3 h}\\ &=-\frac {A}{3 h (g+h x)^3}-\frac {B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{3 h (g+h x)^3}+\frac {(B (b c-a d) n) \int \left (\frac {b^4}{(b c-a d) (b g-a h)^3 (a+b x)}+\frac {d^4}{(b c-a d) (-d g+c h)^3 (c+d x)}+\frac {h^2}{(b g-a h) (d g-c h) (g+h x)^3}-\frac {h^2 (-2 b d g+b c h+a d h)}{(b g-a h)^2 (d g-c h)^2 (g+h x)^2}+\frac {h^2 \left (a^2 d^2 h^2-a b d h (3 d g-c h)+b^2 \left (3 d^2 g^2-3 c d g h+c^2 h^2\right )\right )}{(b g-a h)^3 (d g-c h)^3 (g+h x)}\right ) \, dx}{3 h}\\ &=-\frac {A}{3 h (g+h x)^3}-\frac {B (b c-a d) n}{6 (b g-a h) (d g-c h) (g+h x)^2}-\frac {B (b c-a d) (2 b d g-b c h-a d h) n}{3 (b g-a h)^2 (d g-c h)^2 (g+h x)}+\frac {b^3 B n \log (a+b x)}{3 h (b g-a h)^3}-\frac {B d^3 n \log (c+d x)}{3 h (d g-c h)^3}-\frac {B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{3 h (g+h x)^3}+\frac {B (b c-a d) \left (a^2 d^2 h^2-a b d h (3 d g-c h)+b^2 \left (3 d^2 g^2-3 c d g h+c^2 h^2\right )\right ) n \log (g+h x)}{3 (b g-a h)^3 (d g-c h)^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 1.14, size = 273, normalized size = 0.96 \[ -\frac {B n (b c-a d) \left (-\frac {2 h \log (g+h x) \left (a^2 d^2 h^2+a b d h (c h-3 d g)+b^2 \left (c^2 h^2-3 c d g h+3 d^2 g^2\right )\right )}{(b g-a h)^3 (d g-c h)^3}-\frac {2 b^3 \log (a+b x)}{(b c-a d) (b g-a h)^3}+\frac {2 d^3 \log (c+d x)}{(b c-a d) (d g-c h)^3}-\frac {2 h (a d h+b c h-2 b d g)}{(g+h x) (b g-a h)^2 (d g-c h)^2}+\frac {h}{(g+h x)^2 (b g-a h) (d g-c h)}\right )+\frac {2 B \log \left (e (a+b x)^n (c+d x)^{-n}\right )}{(g+h x)^3}+\frac {2 A}{(g+h x)^3}}{6 h} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [B] time = 3.18, size = 1512, normalized size = 5.32 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [C] time = 1.19, size = 9645, normalized size = 33.96 \[ \text {output too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 1.89, size = 920, normalized size = 3.24 \[ \frac {{\left (\frac {2 \, b^{3} e n \log \left (b x + a\right )}{b^{3} g^{3} h - 3 \, a b^{2} g^{2} h^{2} + 3 \, a^{2} b g h^{3} - a^{3} h^{4}} - \frac {2 \, d^{3} e n \log \left (d x + c\right )}{d^{3} g^{3} h - 3 \, c d^{2} g^{2} h^{2} + 3 \, c^{2} d g h^{3} - c^{3} h^{4}} + \frac {2 \, {\left (3 \, a b^{2} d^{3} e g^{2} n - 3 \, a^{2} b d^{3} e g h n + a^{3} d^{3} e h^{2} n - {\left (3 \, c d^{2} e g^{2} n - 3 \, c^{2} d e g h n + c^{3} e h^{2} n\right )} b^{3}\right )} \log \left (h x + g\right )}{{\left (d^{3} g^{3} h^{3} - 3 \, c d^{2} g^{2} h^{4} + 3 \, c^{2} d g h^{5} - c^{3} h^{6}\right )} a^{3} - 3 \, {\left (d^{3} g^{4} h^{2} - 3 \, c d^{2} g^{3} h^{3} + 3 \, c^{2} d g^{2} h^{4} - c^{3} g h^{5}\right )} a^{2} b + 3 \, {\left (d^{3} g^{5} h - 3 \, c d^{2} g^{4} h^{2} + 3 \, c^{2} d g^{3} h^{3} - c^{3} g^{2} h^{4}\right )} a b^{2} - {\left (d^{3} g^{6} - 3 \, c d^{2} g^{5} h + 3 \, c^{2} d g^{4} h^{2} - c^{3} g^{3} h^{3}\right )} b^{3}} - \frac {{\left (3 \, d^{2} e g h n - c d e h^{2} n\right )} a^{2} - {\left (5 \, d^{2} e g^{2} n - c^{2} e h^{2} n\right )} a b + {\left (5 \, c d e g^{2} n - 3 \, c^{2} e g h n\right )} b^{2} - 2 \, {\left (2 \, a b d^{2} e g h n - a^{2} d^{2} e h^{2} n - {\left (2 \, c d e g h n - c^{2} e h^{2} n\right )} b^{2}\right )} x}{{\left (d^{2} g^{4} h^{2} - 2 \, c d g^{3} h^{3} + c^{2} g^{2} h^{4}\right )} a^{2} - 2 \, {\left (d^{2} g^{5} h - 2 \, c d g^{4} h^{2} + c^{2} g^{3} h^{3}\right )} a b + {\left (d^{2} g^{6} - 2 \, c d g^{5} h + c^{2} g^{4} h^{2}\right )} b^{2} + {\left ({\left (d^{2} g^{2} h^{4} - 2 \, c d g h^{5} + c^{2} h^{6}\right )} a^{2} - 2 \, {\left (d^{2} g^{3} h^{3} - 2 \, c d g^{2} h^{4} + c^{2} g h^{5}\right )} a b + {\left (d^{2} g^{4} h^{2} - 2 \, c d g^{3} h^{3} + c^{2} g^{2} h^{4}\right )} b^{2}\right )} x^{2} + 2 \, {\left ({\left (d^{2} g^{3} h^{3} - 2 \, c d g^{2} h^{4} + c^{2} g h^{5}\right )} a^{2} - 2 \, {\left (d^{2} g^{4} h^{2} - 2 \, c d g^{3} h^{3} + c^{2} g^{2} h^{4}\right )} a b + {\left (d^{2} g^{5} h - 2 \, c d g^{4} h^{2} + c^{2} g^{3} h^{3}\right )} b^{2}\right )} x}\right )} B}{6 \, e} - \frac {B \log \left (\frac {{\left (b x + a\right )}^{n} e}{{\left (d x + c\right )}^{n}}\right )}{3 \, {\left (h^{4} x^{3} + 3 \, g h^{3} x^{2} + 3 \, g^{2} h^{2} x + g^{3} h\right )}} - \frac {A}{3 \, {\left (h^{4} x^{3} + 3 \, g h^{3} x^{2} + 3 \, g^{2} h^{2} x + g^{3} h\right )}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [B] time = 9.26, size = 1183, normalized size = 4.17 \[ \frac {B\,d^3\,n\,\ln \left (c+d\,x\right )}{3\,c^3\,h^4-9\,c^2\,d\,g\,h^3+9\,c\,d^2\,g^2\,h^2-3\,d^3\,g^3\,h}-\frac {\ln \left (g+h\,x\right )\,\left (h^2\,\left (B\,a^3\,d^3\,n-B\,b^3\,c^3\,n\right )-h\,\left (3\,B\,a^2\,b\,d^3\,g\,n-3\,B\,b^3\,c^2\,d\,g\,n\right )+3\,B\,a\,b^2\,d^3\,g^2\,n-3\,B\,b^3\,c\,d^2\,g^2\,n\right )}{3\,a^3\,c^3\,h^6-9\,a^3\,c^2\,d\,g\,h^5+9\,a^3\,c\,d^2\,g^2\,h^4-3\,a^3\,d^3\,g^3\,h^3-9\,a^2\,b\,c^3\,g\,h^5+27\,a^2\,b\,c^2\,d\,g^2\,h^4-27\,a^2\,b\,c\,d^2\,g^3\,h^3+9\,a^2\,b\,d^3\,g^4\,h^2+9\,a\,b^2\,c^3\,g^2\,h^4-27\,a\,b^2\,c^2\,d\,g^3\,h^3+27\,a\,b^2\,c\,d^2\,g^4\,h^2-9\,a\,b^2\,d^3\,g^5\,h-3\,b^3\,c^3\,g^3\,h^3+9\,b^3\,c^2\,d\,g^4\,h^2-9\,b^3\,c\,d^2\,g^5\,h+3\,b^3\,d^3\,g^6}-\frac {B\,\ln \left (\frac {e\,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h^2-2\,a\,b\,d^2\,g^3\,h+b^2\,c^2\,g^2\,h^2-2\,b^2\,c\,d\,g^3\,h+b^2\,d^2\,g^4\right )}+\frac {x^2\,\left (B\,n\,a^2\,d^2\,h^4-2\,B\,g\,n\,a\,b\,d^2\,h^3-B\,n\,b^2\,c^2\,h^4+2\,B\,g\,n\,b^2\,c\,d\,h^3\right )}{a^2\,c^2\,h^4-2\,a^2\,c\,d\,g\,h^3+a^2\,d^2\,g^2\,h^2-2\,a\,b\,c^2\,g\,h^3+4\,a\,b\,c\,d\,g^2\,h^2-2\,a\,b\,d^2\,g^3\,h+b^2\,c^2\,g^2\,h^2-2\,b^2\,c\,d\,g^3\,h+b^2\,d^2\,g^4}}{3\,g^3\,h+9\,g^2\,h^2\,x+9\,g\,h^3\,x^2+3\,h^4\,x^3} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________